package com.sqrj.phoneorder.service;

import com.sqrj.phoneorder.dao.SysUserMapper;
import com.sqrj.phoneorder.model.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

// 根据手机号或邮箱查询是否存在用户
    public SysUser findByKeyword(String keyword) {
        return sysUserMapper.findByKeyword(keyword);
    }
// 根据用户id查询是否存在用户
    public SysUser isBindWXbyopenId(String openId) {
        return sysUserMapper.isBindWXbyopenId(openId);
    }
// 根据用户id查询是否存在用户
    public SysUser findbByopenId(String openId) {
        return sysUserMapper.isBindWXbyopenId(openId);
    }
//  绑定微信用户id
    public int webUserBindWX(String username, String openId) {
        int count = sysUserMapper.webUserBindWX(username,openId);
        return count;
    }
}
